package com.ruoyi.process.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.process.mapper.WorkPackingMapper;
import com.ruoyi.process.domain.WorkPacking;
import com.ruoyi.process.service.IWorkPackingService;

/**
 * 装箱管理Service业务层处理
 *
 * @author ruoyi
 * @date 2021-07-12
 */
@Service
public class WorkPackingServiceImpl implements IWorkPackingService
{
    @Autowired
    private WorkPackingMapper workPackingMapper;

    @Override
    public List<WorkPacking> selectWorkPackingByuserId(Long userId)
    {
        return workPackingMapper.selectWorkPackingByuserId(userId);
    }

    /**
     * 查询装箱管理
     *
     * @param workPackingId 装箱管理ID
     * @return 装箱管理
     */
    @Override
    public WorkPacking selectWorkPackingById(Long workPackingId)
    {
        return workPackingMapper.selectWorkPackingById(workPackingId);
    }

    /**
     * 查询装箱管理列表
     *
     * @param workPacking 装箱管理
     * @return 装箱管理
     */
    @Override
    public List<WorkPacking> selectWorkPackingList(WorkPacking workPacking)
    {
        return workPackingMapper.selectWorkPackingList(workPacking);
    }

    /**
     * 新增装箱管理
     *
     * @param workPacking 装箱管理
     * @return 结果
     */
    @Override
    public int insertWorkPacking(WorkPacking workPacking)
    {
        workPacking.setCreateTime(DateUtils.getNowDate());
        return workPackingMapper.insertWorkPacking(workPacking);
    }

    /**
     * 修改装箱管理
     *
     * @param workPacking 装箱管理
     * @return 结果
     */
    @Override
    public int updateWorkPacking(WorkPacking workPacking)
    {
        workPacking.setUpdateTime(DateUtils.getNowDate());
        return workPackingMapper.updateWorkPacking(workPacking);
    }

    /**
     * 批量删除装箱管理
     *
     * @param workPackingIds 需要删除的装箱管理ID
     * @return 结果
     */
    @Override
    public int deleteWorkPackingByIds(Long[] workPackingIds)
    {
        return workPackingMapper.deleteWorkPackingByIds(workPackingIds);
    }

    /**
     * 删除装箱管理信息
     *
     * @param workPackingId 装箱管理ID
     * @return 结果
     */
    @Override
    public int deleteWorkPackingById(Long workPackingId)
    {
        return workPackingMapper.deleteWorkPackingById(workPackingId);
    }
}
